Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max step frequency of GRBL Atmega328p #41

Closed
pauljay opened this issue Oct 13, 2011 · 15 comments
Closed

max step frequency of GRBL Atmega328p #41

pauljay opened this issue Oct 13, 2011 · 15 comments

Comments

@pauljay
Copy link

pauljay commented Oct 13, 2011

Is there anyone who achieves more than 40KHz step frequency of GRBL Atmega328p ?
I have executed several tests changing microstep level and seekrate of each axis.

The fastest one I have succeeded in is 38.4Hkz for each axis.
If I adjust parameters to get faster speed, then interrupt handler routines went wrong.
So the pulses in my osciloscope shows broken steps.
Also the EEPROM data area is broken to show incorrect values. But it shows correctly after reseting Atmega328p board.

@chamnit
Copy link
Member

chamnit commented Oct 14, 2011

You're likely hitting the limits of grbl. Simen states that 30kHz is about as high as you can go. Keep in mind that torque drops significantly as you reduce the microstepping size. In most scenarios, you should have it as high as you can get away with. I personally run half-steps at most 10kHz, which is slightly louder but I have high torque and can run at higher speeds.

@aldenhart
Copy link

The other thing to note about microstepping is that the supposed accuracy can be illusory. Even if the electrical signal is exact - and it's not always, depending on the driver you are using - the mechanical / electrical system may well not be keeping up with it. As you increase the microsteps and necessarily also the step rate the time the (highly inductive) driver/motor system has to reach full current gets proportionately less. Most drivers do not hit full current in the time interval allowed, thereby further reducing the torque.

This is particularly true at lower voltages, such as 12v. Higher voltages increase the slew rate and therefore the max current that can be delivered in that interval. (Ironically, this makes running drivers and motors at higher voltages actually run cooler as less time is taken in switching).

So if the current can't build up, the motor lags, and the "accuracy" you thought you were getting by upping the microstep rate is lost. This is a problem with many of the belt driven designs that rely on microsteps for accuracy

@pauljay
Copy link
Author

pauljay commented Oct 16, 2011

I agree with Alden. I have tested many stepper drivers including mine. But many drivers lose torque at some point.
The motor voltage I had applied was DC24V. I didn't test with higher voltage. I will try higher voltage input.

One other thing I was curious about is jerky sound during movement in case of high speed seekrate.
I have configured GRBL ( Chamnit version ) as follows.

Microstep : 10
Ball Screwpitch : 10mm

$0=200
$1=200
$2=200

$5=2400 ( seekrate 2400mm/min ) --> 40mm/sec

There is no jerky sound during movement.

But when I apply $5=3600 ( seekrate 3600mm/min ) --> 60mm/sec
It generates a jerky sound during movement. Just one time exactly.

I supposed to capture the pulse train but I couldn't yet.
When I try same configuration on the CNC machine with Mach3, I didn't get such jerky sound at same movement.

Also I tried all previous version ( accellation version GRBL ) but same result I got.
Next week I will try it on my motion controller. And will post the result.

thank you Alden and Chamnit.

By the way, is it better to apply higher voltage to stepper in case of microstepping in general ?

@chamnit
Copy link
Member

chamnit commented Oct 16, 2011

You should always try to run just under the highest voltage that your
motor drivers can handle. This forces the power out of the windings
faster, which means it will let you run at faster feedrates without
losing torque. Also running just under the maximum voltage prevents
damaging your drivers if there is some back EMF somewhere in the
system.

What exactly do you mean by jerky motion and by it happening only
once? When does it happen? Please try to explain in detail so I can
troubleshoot it.

On Oct 15, 2011, at 9:54 PM, pauljay
reply@reply.github.com
wrote:

I agree with Alden. I have tested many stepper drivers including mine. But many drivers lose torque at some point.
The motor voltage I had applied was DC24V. I didn't test with higher voltage. I will try higher voltage input.

One other thing I was curious about is jerky sound during movement in case of high speed seekrate.
I have configured GRBL ( Chamnit version ) as follows.

Microstep : 10
Ball Screwpitch : 10mm

$0=200
$1=200
$2=200

$5=2400 ( seekrate 2400mm/min ) --> 40mm/sec

There is no jerky sound during movement.

But when I apply $5=3600 ( seekrate 3600mm/min ) --> 60mm/sec
It generates a jerky sound during movement. Just one time exactly.

I supposed to capture the pulse train but I couldn't yet.
When I try same configuration on the CNC machine with Mach3, I didn't get such jerky sound at same movement.

Also I tried all previous version ( accellation version GRBL ) but same result I got.
Next week I will try it on my motion controller. And will post the result.

thank you Alden and Chamnit.

By the way, is it better to apply higher voltage to stepper in case of microstepping in general ?

Reply to this email directly or view it on GitHub:
https://github.com/simen/grbl/issues/41#issuecomment-2418960

@pauljay
Copy link
Author

pauljay commented Oct 16, 2011

Thank you for your comment.
Under the condition I have describerd in previous post I have tested fast move. G0 command.
$0=200 ( 10 microstep - 10mm advance in 1 revolution of step motor )
$5=3600 ( 60mm advance in 1 second )
$7=0
$8 ( accel ) = 80

My machine is 300x200x60 ( X/Y/Z mm )
The ball screw is used and LM guide is used for linear motion.

The motor is Tamagawa High Torque 2A 0.8degree Bipolar step motor. The step driver is IMS IM483.
The supply voltage for motor is DC24V.

So when I travel X,Y, there is a jerky sound which resembles a break sound to stop momentarily.
I guess some step pulses are lost in steady state after accel is finished.

For example, when I input G0 X50. It generates the sound in the position around between 20 ~25mm.
Now the X position is 50. And then input G0 X100. Then also it generates the sound in position around 70 ~75mm.

But below 20mm movement, there is no such a jerky sound.
It happens always to move more than 20mm from its current position.

This happens in all of my stepper drivers.

@pauljay
Copy link
Author

pauljay commented Oct 16, 2011

I guess this scenario might be applied in the jerky sound.

  1. step pulses are generated in accel profile.
  2. the stepper reaches a target speed.
  3. after that, the step pulses are lost
  4. Then step motor stop momentarily
  5. Now pulses are applied tagain then motor gets pulses at normal speed.
  6. This generates very tough sound because motor starts from stop without accel.

This is my guess so that i supposed to capture the step pulses in my osciloscope.

@pauljay pauljay closed this as completed Oct 16, 2011
@pauljay pauljay reopened this Oct 16, 2011
@chamnit
Copy link
Member

chamnit commented Oct 16, 2011

Thanks for the info. What you state is in agreement with a problem at the end of an acceleration, which should end at about 22.5mm from the start position. And your settings seem like they should work on grbl. However, logically, the program shouldn't be losing steps after acceleration. There must be something else going on here.

Although I have not run at high feedrates that you are trying to achieve. Alden: How fast have you gotten on your CNCs?

Some other questions:

  • When you say that you tried this on Mach3 with the same settings. Are they exactly the same? The reason I ask is if this is an issue with torque.
  • Which other versions of grbl have you tried? Simen's master and 0.7b edge?
  • Do you have any issues for a longer or shorter motion? Like G0X100 or G0X25? Or even just a little longer like G0X60?
  • Does this jerky sound happen once after it gets past 22.5mm? Or does it do it throughout the rest of motion?
  • There is a problem where the settings can get corrupt if you switch versions of grbl. They all use different settings internally. So just make sure that you re-write them to ensure that they are ok.

I will try to reproduce this problem on my end and see if I find out what's going on. There has been a report about some jerky motion at the end of acceleration before I had started working on this code. I thought I had fixed it, but it maybe something inherent in grbl that I overlooked. Pauljay, I'd really like to help you solve this, mainly to fix any grbl bugs before going to a v1.0.

@chamnit
Copy link
Member

chamnit commented Oct 16, 2011

I can't reproduce this error, since my system can't go to the peak speed you have. But, I did try many different scenarios to see if I can observe it. I don't own an oscilloscope (on the list of things to buy), so I can't actually see the step pulses real time, only what my CNC mill shows me. When you say you have captured on your oscilloscope, have you actually seen this pause in step pulses at the end of acceleration? And only there?

@pauljay
Copy link
Author

pauljay commented Oct 17, 2011

HI Chamnit and Alden,

I found out it was because of torque. This morning simply I have applied DC36V for step driver and get the result what I want. No jerky sound during movement. I am using very slow feedrate rather seekrate is high.

I have tested it on Chamnit fork of GRBL.
Also I didn't find long slow decelleration tail.
Thank you Chamnit and Alden.

@pauljay pauljay closed this as completed Oct 17, 2011
@dmmedia
Copy link

dmmedia commented Mar 18, 2012

I have just checked my config in terms of maths and figured out, that 24.8 steps/mm and 2500mm/min seek rate give 62kHz step rate.
Am I pushing GRBL limits too much? All motions smooth and seems to lose no steps.
Do I understand properly, that those figures do not mean that I achieve 2.5m/min speed, but merely, that my Arduino slows down?

@chamnit
Copy link
Member

chamnit commented Mar 18, 2012

Theoretically, grbl should be able to go up to about a 100kHz step rate, but there are many many other things that can cause it to choke like the stepper interrupt slowing down the main program (parser and planner) or your motor drivers not being able to keep up. The biggest issue would crop up in cases of rapid short line segments like on curves or performing arc motions. Although depending on your system size and acceleration setting, you may never reach your maximum feed rate and your result might be hidden. If your system can do arcs/curves and work when accelerated all the way to the maximum feedrate, I would say that you have the fastest confirmed step rate reported so far.

@dmmedia
Copy link

dmmedia commented Mar 18, 2012

I am sorry. I've just found out, that I've messed m/min with m/sec, which gives humble 1kHz step rate.

@mihaisalajan
Copy link

Hi everyone

I have a small issue. please help me.

I just start using GRBL V0.8 firmware, my board is arduino uno the stepper is a nema14 200 steps /revolution the driver is a4988, i am turning a screw with 8mm lead that means 25 steps/ mm
but the motor is making a lot of noise and the speed is slow, if i set the steps at 100 steps/mm the axis is moving just fine without noise and the speed is just right but than when i tell it to move 1 mm it moves 4 mm (!!!obvious!!! ) i tried different speeds ($4 adn $5 from 100-3600) but nothing changes. i need to mention that i am using grbl controller 3.6.1
i also tried different step pulses ($3) from 3 to 30 still without result
another question how ca i set the tA and tB from picture below at the value of 1µs , I had the impression that this is setup with the speed adjustment

or is it that tA is $3 command and tB is $4and $5 commands ?

step a4988

PS please excuse my english is not my native language

@oleometal
Copy link

que tengo que hacer para correr grbl a 100 khz, ??
nececito 500 khz para controlar un servomotor yaskawa.

@ibrahimuslu
Copy link

que tengo que hacer para correr grbl a 100 khz, ??
nececito 500 khz para controlar un servomotor yaskawa.

Hello oleometal,

Did you achieve to run grbl in 100khz? I need to run Hiwin servo drivers at 600khz ? If you have any solution, could you share with us? Thank you.
Hola oleometal, necesito correr Hiwin servomotors tambien a 600khz. puedes hacer un solucion? Gracias para tu contribucion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants